<?php
/**
 * Created by PhpStorm.
 * User: HS032
 * Date: 2020/9/8
 * Time: 10:05
 */

namespace ticket\modules\backend\controllers;

use ticket\libs\Tools;
use ticket\modules\backend\models\PayConfig;
use Yii;

class PayController extends BasicController
{

    public function actionPayConfigInfo()
    {
        $app_id = $this->appId;
        $payConfigModel = new PayConfig();
        $data = $payConfigModel->getInfo($app_id);
        return Tools::showRes(0,'success',[
            'payConfigInfo' => $data,
        ]);
        
    }

    public function actionSetPayConfig()
    {
        if (Yii::$app->request->isPost){
            $post = Yii::$app->request->post();
            $app_id = $this->appId;
            $payConfigModel = new PayConfig();
            if ($payConfigModel->setPayConfig($app_id,$post)){
                return Tools::showRes(0,'success');
            }
            return Tools::showRes(10405,'操作失败');
        }
    }
    

}